// Learn cc.Class:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
// Learn Attribute:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
// Learn life-cycle callbacks:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html

cc.Class({
    extends: cc.Component,

    properties: {
        labUserNum: cc.Label,   //房间在线人数 
        labRoomNameCode: cc.Label,  //房间名与编号

    },

    // LIFE-CYCLE CALLBACKS:

    init: function(data){
        this.labUserNum.string = '在线 '+data.roomNums+' 人';
        this.labRoomNameCode.string = data.roomName;
    },

    //更新人数
    updateNums:function(num){
        this.labUserNum.string = '在线 '+data.roomNums+' 人';
    }
    
    // update (dt) {},
});
